package com.tee.rocketmqstudy.demo;

import com.tee.rocketmqstudy.constant.MqConstant;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.common.message.Message;
import org.junit.Test;

/**
 * @author tee
 * @date 2025/9/9
 */
public class COneWayTest {

    @Test
    public void oneWayProduce() throws Exception {
        DefaultMQProducer producer = new DefaultMQProducer("oneWay-producer-group");
        producer.setNamesrvAddr(MqConstant.NAME_SRV_ADDR);
        producer.start();
        Message message = new Message("oneWayTopic", "oneWayMsg".getBytes());
        producer.sendOneway(message);
    }
}
